#coding:utf-8
def largest(l):
    """
  获得整数数组中的最大值
  参数: l :一个list或元组,所有元素都是整数.
  """
   
#     for i in range(0,len(l)):
#         for j in range(i+1,len(l)):
#             num1=int(l[i])
#             num2=int(l[j])
#             if num1<num2:
#                 l[i]=num2
#                 l[j]=num1
#     print l
#     print l[0]
# largest([2,4,6,1,10,20])

    if not l:
        return None
    else:
        max=l[0]
        for i in l:
            if max<i:
                max =i
        return max
        
l = [5,9,7,3]
print largest(l)
